package com.itheima.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @version V1.0
 * @author: yongjichu
 * @date: 2020/2/8 14:40
 * @description:
 */
@RestController
@RequestMapping("/demo")
public class SecurityDemoController {
    @PreAuthorize("hasAuthority('checkitem_add')")
    @RequestMapping("/add")
    public String add(){
        return "add";
    }
    @PreAuthorize("hasAuthority('checkitem_delete')")
    @RequestMapping("delete")
    public String delete(){
        return "delete";
    }
}
